package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConstant;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.CheckGroup;
import com.itheima.pojo.Member;
import com.itheima.pojo.Order;
import com.itheima.service.CheckGroupService;
import com.itheima.service.MemberService;
import com.itheima.service.OrderService;
import com.itheima.utils.DateUtils;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 检查组管理
 */

@RestController
@RequestMapping("/member")
public class MemberController {
    @Reference
    private MemberService memberService;

    //新增检查组
    @RequestMapping("/add")
    public Result add(@RequestBody Map map, Integer[] seatmealIds){
        map.put("orderType", Order.ORDERTYPE_TELEPHONE);
        Result result=null;
        try{
            result = memberService.order(map,seatmealIds);
            //存在
        }catch (Exception e){
            e.printStackTrace();
            return new Result(false,MessageConstant.ORDERSETTING_FAIL);//新增失败
        }
        return result;
    }
}
